#ifndef ESTIMATOR_H_INCLUDED
#define ESTIMATOR_H_INCLUDED

#include <iostream>
#include <list>
#include <ctime>
#include "RouteTypes.h"

using namespace std;

//Estimator.h - Encapsulates all logic for computing a meaningful time estimation,
//is aggregated by the Estimation State Manager class

enum Trend{
    TREND_UPWARD,
    TREND_DOWNWARD,
    TREND_NONE
};

class Estimator{

    private:
    list<float> averageQueue;

    time_t trendTimer[2];
    time_t delayTimer[2];
    int noTrendInterval;
    int delayStateInterval;
    float timeDifference[2];
    float currentEstimate;

    float newEstimate();
    Trend trend();

    public:

    float GetEstimate(float avg);
    Estimator();

};


#endif // ESTIMATOR_H_INCLUDED
